In [1]:
import matplotlib.pyplot as plt
from numpy import pi, sin, cos, linspace, exp, real, imag, abs, conj, angle, unwrap
from numpy.fft import fft, fftshift
import numpy as np
In [2]:
%matplotlib inline
In [41]:
b=.08*1e-3
a=.25*1e-3
k=2*pi/(795*1e-9)
wt=0
C=1
L=1.9
d=.03
ccdsize = 1300
In [4]:
def alpha(y):
return k*a*y/(2*L)
In [5]:
def beta(y):
return k*b*y/(2*L)
In [6]:
def E(y):
return b*C*(sin(beta(y)) / beta(y)) * (sin(wt-k*L) + sin(wt-k*L+2*alpha(y)))
In [7]:
import BeamOptics as bopt
In [105]:
d=.045
pixwidth = 1e-5 # CCD pixel width
y = linspace(-pixwidth*ccdsize/2,pixwidth*ccdsize/2,ccdsize)
In [106]:
#E_lo_gauss = bopt.gaussian_beam(0,y,10*L,E0=0.005,wavelambda=795e-9,w0=0.0030,k=[0,k*d/L,k])
E_lo_gauss = bopt.gaussian_beam(0,y,L,E0=0.005,wavelambda=795e-9,w0=0.0060,k=[0,k*d/L,k])
#TODO: change to normal LO and angled signal
In [107]:
plt.plot(y,unwrap(angle(E_lo_gauss)))
#plt.ylim([0,0.005])
Out[107]:
Interesting, the phase fronts are pretty flat under these conditions. Need to revisit the Zernike model we started?
In [108]:
plt.plot(y,abs(E_lo_gauss))
plt.ylim([0,0.005])
Out[108]:
In [109]:
TotalIntensity=(E(y)+E_lo_gauss) * (E(y)+E_lo_gauss).conj()
In [110]:
plt.figure(figsize=(14,4))
plt.plot(y,TotalIntensity,".-")
#plt.xlim([-.002,0])
Out[110]:
In [111]:
plt.plot(abs(fft(TotalIntensity)),".-")
plt.ylim([0,.0005]) # Had to lower the LO power quite a bit, and then zoom way in.
plt.xlim([300,500])
Out[111]:
In [85]:
N=15
data = np.zeros((ccdsize,N))
wmin = 0.001
wmax = 0.010
wlist = linspace(wmin,wmax,N)
for i,w in enumerate(wlist):
E_lo_gauss = bopt.gaussian_beam(0,y,0,E0=0.005,wavelambda=795e-9,w0=w,k=[0,k*d/L,k])
TotalIntensity=(E(y)+E_lo_gauss) * (E(y)+E_lo_gauss).conj()
data[:,i] = abs(fft(TotalIntensity))
#plt.plot(abs(fft(TotalIntensity)),".-")
#plt.xlim([150,275])
#plt.ylim([0,0.00003])
In [88]:
plt.imshow(data[375:450,:])
Out[88]:
In [89]:
plt.plot(data[375:450,:])
Out[89]:
In [100]:
Z = data[375:450,:]
xs = wlist
ys = np.linspace(150, 275, Z.shape[0])
X, Y = np.meshgrid(xs, ys)
In [101]:
from mpl_toolkits.mplot3d import axes3d
In [103]:
fig = plt.figure(figsize=(15,10))
ax = fig.add_subplot(111, projection='3d')
wframe = ax.plot_wireframe(X, Y, data[375:450,:],rstride=100)
plt.ylabel("Mode index")
plt.xlabel("w_0")
Out[103]:
The spot size effectively determines the resolution. Gaussian blurring takes over for small spot sizes.
In [ ]: